/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.aggjpsv.libraryserver.entities;

/**
 *
 * @author SergioPeres
 */
public class HTTPHead {
    private String method;
    private String uri;
    private String protocol;
    private String resto;
    private String host;
    private String referer;
    private String contentType;
    private String boundary;
    private int contentLength;

    public HTTPHead() {}
    
    public HTTPHead(String method, String uri, String protocol, String resto, String host, String referer, String contentType, String boundary, int contentLength) {
        this.method = method;
        this.uri = uri;
        this.protocol = protocol;
        this.resto = resto;
        this.host = host;
        this.referer = referer;
        this.contentType = contentType;
        this.boundary = boundary;
        this.contentLength = contentLength;
    }

    @Override
    public String toString() {
        return    "metodo: " + method + "\n"
                + "url: " + uri + "\n"
                + "protocol: " + protocol + "\n"
                + "host: " + host + "\n" +
                ((method.equalsIgnoreCase("POST")) ? 
                ("referer: " + referer + "\n"
                + "cntent-type: " + contentType + " " + boundary + "\n"
                + "cotent-length: " + contentLength + "\n") : "");
    }

    //<editor-fold defaultstate="collapsed" desc=" Get's & Set's ...">
    public String getMethod() {
        return method;
    }
    
    public void setMethod(String method) {
        this.method = method;
    }
    
    public String getUri() {
        return uri;
    }
    
    public void setUri(String uri) {
        this.uri = uri;
    }
    
    public String getProtocol() {
        return protocol;
    }
    
    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }
    
    public String getResto() {
        return resto;
    }
    
    public void setResto(String resto) {
        this.resto = resto;
    }
    
    public String getHost() {
        return host;
    }
    
    public void setHost(String host) {
        this.host = host;
    }
    
    public String getReferer() {
        return referer;
    }
    
    public void setReferer(String referer) {
        this.referer = referer;
    }
    
    public String getContentType() {
        return contentType;
    }
    
    public void setContentType(String contentType) {
        this.contentType = contentType;
    }
    
    public String getBoundary() {
        return boundary;
    }
    
    public void setBoundary(String boundary) {
        this.boundary = boundary;
    }
    
    public int getContentLength() {
        return contentLength;
    }
    
    public void setContentLength(int contentLength) {
        this.contentLength = contentLength;
    }
//</editor-fold>
    
    
}
